<?php
/**
 * User: @lixu
 * Date: 2019-08-12
 * Time: 14:37
 */

use Infinity\service\designerVote\Detail as sDetail;

use Doraemon\tools\HhzClient as tHhzClient;
/**
 * @deprecated
 */
class DetailAction extends ActionPlugin
{

    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $otherCase = [];
        $userInfo = [];
        $id = $this->getRequest()->getQuery('id');

        if(!$id) {
            throw new \Exception('案例id错误');
        }

        $detail = sDetail::getCaseAttr($id);
        if($detail) {
            $otherCase = sDetail::getOtherCaseList($detail['designer_id'], $id);
        }

        if($this->uid != 0 ) {
            $userInfo = sDetail::getUserInfo($this->uid);
        }

        $list['list'] = [
            'detail' => $detail ? : [],
            'other_case' => $otherCase ? : [],
            'user_info' => $userInfo ? : (object) [],
        ];

        $this->SetSuccess($list);

    }
}